/* Copyright (c) 2010, Peter Lényi */
/* Licensed under The BSD License. */

package gem.apps.gfs2.engine.entity;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;

/**
 * Entity class Style encapsulates application Style personalized for each user.
 * 
 * @author Peter Lényi
 * @version 20100515F
 */
@Entity
public class Style implements Serializable
{
    /**
     * uid
     * owner
     * bgcolor P/S/T
     * fgcolor P/S/T
     * htcolor P/S/T
     * lncolor P/S/T
     * font P/S/T
     * size P/S/T
     */
    
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    private Long uid;
    @OneToOne
    private Person owner;
    /** Page's background colour. */
    private String bgcolorPrimary;
    /** Specific block elements' background colour. */
    private String bgcolorSecondary;
    /** Code blocks' background colour. */
    private String bgcolorTernary;
    /** Basic text colour. */
    private String fgcolorPrimary;
    /** Text colour in specific block elements. */
    private String fgcolorSecondary;
    /** Text colour in code blocks. */
    private String fgcolorTernary;
    /** Unvisited hypertext link colour. */
    private String htcolorPrimary;
    /** Active hypertext link colour. */
    private String htcolorSecondary;
    /** Visited hypertext link colour. */
    private String htcolorTernary;
    /** Table border lines' colour. */
    private String lncolorPrimary;
    /** Specific block elements border lines' colour. */
    private String lncolorSecondary;
    /** Code block border lines' colour. */
    private String lncolorTernary;
    /** Basic text font. */
    private String fontPrimary;
    /** Header text font. */
    private String fontSecondary;
    /** Code text font. */
    private String fontTernary;
    /** Page width. */
    private String sizePrimary;
    /** Basic text font size. */
    private String sizeSecondary;
    /** Border lines' width. */
    private String sizeTernary;

    public Style() {}

    public String getBgcolorPrimary() {
        return bgcolorPrimary;
    }

    public void setBgcolorPrimary(String bgcolorPrimary) {
        this.bgcolorPrimary = bgcolorPrimary;
    }

    public String getBgcolorSecondary() {
        return bgcolorSecondary;
    }

    public void setBgcolorSecondary(String bgcolorSecondary) {
        this.bgcolorSecondary = bgcolorSecondary;
    }

    public String getBgcolorTernary() {
        return bgcolorTernary;
    }

    public void setBgcolorTernary(String bgcolorTernary) {
        this.bgcolorTernary = bgcolorTernary;
    }

    public String getFgcolorPrimary() {
        return fgcolorPrimary;
    }

    public void setFgcolorPrimary(String fgcolorPrimary) {
        this.fgcolorPrimary = fgcolorPrimary;
    }

    public String getFgcolorSecondary() {
        return fgcolorSecondary;
    }

    public void setFgcolorSecondary(String fgcolorSecondary) {
        this.fgcolorSecondary = fgcolorSecondary;
    }

    public String getFgcolorTernary() {
        return fgcolorTernary;
    }

    public void setFgcolorTernary(String fgcolorTernary) {
        this.fgcolorTernary = fgcolorTernary;
    }

    public String getFontPrimary() {
        return fontPrimary;
    }

    public void setFontPrimary(String fontPrimary) {
        this.fontPrimary = fontPrimary;
    }

    public String getFontSecondary() {
        return fontSecondary;
    }

    public void setFontSecondary(String fontSecondary) {
        this.fontSecondary = fontSecondary;
    }

    public String getFontTernary() {
        return fontTernary;
    }

    public void setFontTernary(String fontTernary) {
        this.fontTernary = fontTernary;
    }

    public String getHtcolorPrimary() {
        return htcolorPrimary;
    }

    public void setHtcolorPrimary(String htcolorPrimary) {
        this.htcolorPrimary = htcolorPrimary;
    }

    public String getHtcolorSecondary() {
        return htcolorSecondary;
    }

    public void setHtcolorSecondary(String htcolorSecondary) {
        this.htcolorSecondary = htcolorSecondary;
    }

    public String getHtcolorTernary() {
        return htcolorTernary;
    }

    public void setHtcolorTernary(String htcolorTernary) {
        this.htcolorTernary = htcolorTernary;
    }

    public String getLncolorPrimary() {
        return lncolorPrimary;
    }

    public void setLncolorPrimary(String lncolorPrimary) {
        this.lncolorPrimary = lncolorPrimary;
    }

    public String getLncolorSecondary() {
        return lncolorSecondary;
    }

    public void setLncolorSecondary(String lncolorSecondary) {
        this.lncolorSecondary = lncolorSecondary;
    }

    public String getLncolorTernary() {
        return lncolorTernary;
    }

    public void setLncolorTernary(String lncolorTernary) {
        this.lncolorTernary = lncolorTernary;
    }

    public String getSizePrimary() {
        return sizePrimary;
    }

    public void setSizePrimary(String sizePrimary) {
        this.sizePrimary = sizePrimary;
    }

    public String getSizeSecondary() {
        return sizeSecondary;
    }

    public void setSizeSecondary(String sizeSecondary) {
        this.sizeSecondary = sizeSecondary;
    }

    public String getSizeTernary() {
        return sizeTernary;
    }

    public void setSizeTernary(String sizeTernary) {
        this.sizeTernary = sizeTernary;
    }

    public Person getOwner() {
        return owner;
    }

    public void setOwner(Person owner) {
        this.owner = owner;
    }

    public Long getUid() {
        return uid;
    }

    public void setUid(Long uid) {
        this.uid = uid;
    }

    @Override
    public boolean equals(Object o) {
        boolean equal = false;
        if (o != null && o instanceof Person) {
            Style s = (Style) o;
            if (uid == s.uid) {
                equal = true;
            }
        }
        return equal;
    }

    @Override
    public int hashCode() {
        return uid.hashCode();
    }

    @Override
    public String toString() {
        return "GFS2:Style#" + uid;
    }
}